package com.chen.qmzy.controller;

import com.chen.qmzy.service.DwIndexService;
import jakarta.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.*;

@CrossOrigin//跨域
@RestController//遵循RestFul
@RequestMapping("v2/DwIndex/")
public class DwIndexController {
    private static final Logger logger= LoggerFactory.getLogger(MessageController.class);//日志getLogger需要传入的类名
    @Resource
    private RedisTemplate<String ,String> redisTemplate;//Redis工具类
    @Resource
    DwIndexService dwIndexService;

    /**
     * 获取首页商品列表
     * @return json
     */
    @GetMapping("Product")
    private String getProductList()
    {
        return dwIndexService.getProductList();
    }

    /**
     * 获取首页轮播列表
     * @return json
     */
    @GetMapping("Carousel")
    private String getCarouselList()
    {
        return dwIndexService.getCarouselList();
    }
}

